let photoUrl = '';
for (let i = 0; i < 10 * 1024 * 1024; i++) photoUrl += "*";

let token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjEsInVzZXJuYW1lIjoi5rWL6K-V6LSm5Y-3Leezu-e7n-euoeeQhuWRmCIsInVzZXJUeXBlIjoi57O757uf566h55CG5ZGYIiwiaWF0IjoxNzM3NTQ1NzgzLCJleHAiOjE3Mzc2MTc3ODN9.oJvwYgz1wt0b_BOga0iqqrGHFLGvHaIgcUXSJckYZTI';

// 测试病例档案接口
(function () {
    var myHeaders = new Headers();
    myHeaders.append("Authorization", token);
    myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
    myHeaders.append("Content-Type", "application/json");
    
    var raw = JSON.stringify({
       "studentId": "1",
       "time": "2025-1-20",
       "hospital": "xxxxxxxxxxxx",
       "sickenTypeId": "1",
       "note": "sssssssss",
       "photoUrl": photoUrl
    });
    
    var requestOptions = {
       method: 'POST',
       headers: myHeaders,
       body: raw,
       redirect: 'follow'
    };
    
    fetch("http://127.0.0.1:3000/sicken/addSickenRecord", requestOptions)
       .then(response => response.json())
       .then(result => console.log("上传病例档案", result))
       .catch(error => console.log('error', error));
})();


// 测试新增日常访谈接口
(function () {
    var myHeaders = new Headers();
    myHeaders.append("Authorization", token);
    myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
    myHeaders.append("Content-Type", "application/json");

    var raw = JSON.stringify({
        "studentId": "1",
        "startTime": "2024-09-21 09:00:00",
        "endTime": "2024-09-21 10:00:00",
        "teacherId": 4,
        "interviewContent": "测试日常访谈功能",
        "isWarning": "true",
        "interviewPhoto": photoUrl
    });

    var requestOptions = {
        method: 'POST',
        headers: myHeaders,
        body: raw,
        redirect: 'follow'
    };

    fetch("http://127.0.0.1:3000/interview/addDailyVisitInterview", requestOptions)
        .then(response => response.json())
        .then(result => console.log("新增日常访谈接口", result))
        .catch(error => console.log('error', error));

})();


// 测试新增普查访谈接口
(function () {
    var myHeaders = new Headers();
    myHeaders.append("Authorization", token);
    myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
    myHeaders.append("Content-Type", "application/json");

    var raw = JSON.stringify({
        "studentId": "1",
        "startTime": "2024-09-21 09:00:00",
        "endTime": "2024-09-21 10:00:00",
        "counselorId": 5,
        "question1": "最近的情绪不太行，改这个系统的bug改到吐",
        "question2": "最近的学习都落下了",
        "question3": "人际关系还不错，认识了几个新的朋友",
        "question4": "对学校的喜爱还是不错的哈哈哈哈",
        "question5": "家庭情况贼好",
        "question6": "睡觉嘛，晚上总是睡不着，我总觉得可能是有心事",
        "question7": "怎么可能，我怎么可能自杀，老子贼惜命",
        "note": "测试普查访谈接口功能",
        "centerOpinionId": 1,
        "warningLevelId": 1,
        "interviewPhoto": photoUrl
    });

    var requestOptions = {
        method: 'POST',
        headers: myHeaders,
        body: raw,
        redirect: 'follow'
    };

    fetch("http://127.0.0.1:3000/interview/addCensusVisitInterview", requestOptions)
        .then(response => response.json())
        .then(result => console.log("新增普查访谈接口", result))
        .catch(error => console.log('error', error));

})();


// 测试新增家校沟通接口
(function () {
    var myHeaders = new Headers();
    myHeaders.append("Authorization", token);
    myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
    myHeaders.append("Content-Type", "application/json");

    var raw = JSON.stringify({
        "studentId": 1,
        "startTime": "2024-09-21 09:00:00",
        "endTime": "2024-09-21 10:00:00",
        "teacherId": 4,
        "interviewContent": "测试家校沟通访谈功能",
        "isWarning": "true",
        "interviewPhoto": photoUrl
    });

    var requestOptions = {
        method: 'POST',
        headers: myHeaders,
        body: raw,
        redirect: 'follow'
    };

    fetch("http://127.0.0.1:3000/interview/addHomeSchoolInterview", requestOptions)
        .then(response => response.json())
        .then(result => console.log("新增家校沟通接口", result))
        .catch(error => console.log('error', error));
})();